<?php

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("header.php", $_SERVER['SCRIPT_NAME'])) {
    Header("Location: index.php");
    die();
}
require_once("mainfile.php");



##################################################
# Include some common header for HTML generation #
##################################################

$header = 1;

function head() {
    global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
    include("includes/ipban.php");
    $ThemeSel = get_theme();
    include("themes/$ThemeSel/theme.php");
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    echo "<html>\n";
    echo "<head>\n";
    echo "<title>$pagetitle | $sitename</title>\n";
    include("includes/meta.php");
    include("includes/javascript.php");

    if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
	echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
    }
    echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
    if (file_exists("includes/custom_files/custom_head.php")) {
	  include_once("includes/custom_files/custom_head.php");
    }
	/*echo "<script type=\"text/javascript\">

			
			function dw_loadExternal(url, ifrmId, divId, bLoadMsg) {
			    // defaults for iframe, display div
			    ifrmId = ifrmId || 'buffer'; divId = divId || 'display'; 
			    if ( window.frames[ifrmId] ) {
			        // Could use location.replace method if you do not want back button to load previous iframe url 
			        //window.frames[ifrmId].location.replace(url);
			        window.frames[ifrmId].location = url;
			        var lyr = document.getElementById? document.getElementById(divId): null;
			        if ( lyr && bLoadMsg ) { // Option to display message while retrieving data 
			            lyr.innerHTML = '<p>Retrieving data. Please wait ...</p>';
			            lyr.style.display = 'block'; 
			        }
			        return false;
			    } 
			    return true; // other browsers follow link
			}
		
			
			
			// called onload of iframe 
			// displays body content of iframed doc in div
			// checks for and invokes optional functions in both current document and iframed document 
			function dw_displayExternal(ifrmId, divId, fp) {
			    // defaults for iframe, display div
			    ifrmId = ifrmId || 'buffer'; divId = divId || 'display'; 
			    
			    var lyr = document.getElementById? document.getElementById(divId): null;
			    if ( window.frames[ifrmId] && lyr ) {

			    	//alert(lyr.innerHTML = document.getElementById(\"buffer\").innerHTML);
			        lyr.innerHTML = window.frames[ifrmId].document.body.innerHTML;
			        lyr.style.display = 'block'; 
			
			        
			        // when using with script, may have some operations to coordinate
			        // function in current doc or iframed doc (doOnIframedLoad)
			        if ( typeof fp == 'function' ) {
			            fp();
			        }
			        
			        // Demonstrated in tooltip demo
			        if ( typeof window.frames[ifrmId].doOnIframedLoad == 'function' ) {
			            window.frames[ifrmId].doOnIframedLoad();
			        }
			     
			    }
			}
					</script>";*/
					
    echo "<link rel=\"StyleSheet\" href=\"modules/topics/dtree/dtree.css\" type=\"text/css\" />
		<script type=\"text/javascript\" src=\"modules/topics/dtree/dtree.js\"></script>

		<script type=\"text/javascript\">
		function setIframeHeight(iframeName) {
		  //var iframeWin = window.frames[iframeName];
		  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
		  if (iframeEl) {
		  iframeEl.style.height = \"auto\"; // helps resize (for some) if new doc shorter than previous
		  //var docHt = getDocHeight(iframeWin.document);
		  // need to add to height to be sure it will all show
		  var h = alertSize();
		  var new_h = h+10;
		  iframeEl.style.height = new_h + \"px\";
		  //alertSize();
		  }
		}

		function alertSize() {
		  var myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myHeight = document.body.clientHeight;
		  }
		  //window.alert( 'Height = ' + myHeight );
		  return myHeight;
		}
	</script>
		
				";
    echo "\n\n\n</head>\n\n";
    if (file_exists("includes/custom_files/custom_header.php")) {
	  include_once("includes/custom_files/custom_header.php");
    }
    themeheader();
}

online();
head();
include("includes/counter.php");
global $home; 
if ($home == 1) { 
    message_box(); 
} 


    blocks(Center); 


?>
